<template>
  <a-form-item
    label="姓名"
    name="name"
    :rules="[{ required: true, message: '请输入姓名' }]"
  >
    <a-input
      :value="$props.name"
      @update:value="$emit('update:name', $event)"
    />
  </a-form-item>
  <a-form-item
    label="年龄"
    name="age"
    :rules="[{ required: true, message: '请输入年龄' }]"
  >
    <a-input-number
      :value="$props.age"
      @update:value="$emit('update:age', $event)"
    />
  </a-form-item>
  <a-button @click="$emit('update:msg', 1, 2, 3)">点我</a-button>
</template>

<script lang="ts">
import { PropType } from "vue";
export default defineComponent({
  name: "ItemSet",
  props: {
    name: {
      type: String,
      default: "",
    },
    age: {
      type: Number,
      default: 0,
    },
  },
  emits: ["update:name", "update:age", "update:msg"],
  setup(props) {
    return {};
  },
});
</script>

<style scoped></style>
